package com.wenx;

import com.wenx.config.MainConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class GetBeanFromConfigClassTest {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfig.class);

        Person person = (Person) applicationContext.getBean("person");

        System.out.println("person = " + person);

    }
}
